home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 37
/
Aminet 37 (2000)(Schatztruhe)[!][Jun 2000].iso
/
Aminet
/
util
/
wb
/
THE.lha
/
T.H.E.
/
Prefs
/
THE
next >
Wrap
Text File
|
2000-04-07
|
42KB
|
1,288 lines
/*
$VER: RA_THE.rexx 1.4 (7.4.00) Copyright (c) Nils Görs.
Thanks to William Parker for writing AWNP, for teaching me how to
use it and for the help.
This script is for editing the Tools-Menu and Hotkey functions from Workbench.
The script creates an ARexx-Script that will be placed in WBStartup. You have
to create an Icon for this script to be executed automatically.
This script needs:
- AWNPipe: ver 2.42 or newer.
- workbench.library v44.1414 or newer.
*/
Scriptname = "Sys:WBStartup/setKeyAndMenu"
QuickEnd = "YES" /* quit T.H.E with [ESC] (YES|NO) */
Horizline = "NO" /* use horizontal lines? (YES|NO) */
mxchars = 256 /* Maximum number of character/digits in argument gadget. */
/*
*** Please don't change anything under this line
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
options results
parse source . . called .
PARSE ARG PubScreen
IF PubScreen = "" THEN PubScreen = "Workbench"
ADDRESS workbench
call _InitAll()
call BuildGUI()
Loop:
do while ~eof(ca)
call topipe('con')
in= readln(ca)
/*listviews need five values parsed. For string gadgets you want everything after in2 */
parse var in in1 in2 in3 in4 in5 .
parse var in . . infromstring
SELECT
WHEN in1='arexx' then call RxHost()
WHEN in1='iconify' then call iconify()
WHEN in1='gadget' then call gadget()
WHEN in1='menu' then call menu()
WHEN in1='close' then CALL MYEXIT()
WHEN in1='key' then call keystroke()
WHEN in1='cx' then call commodity()
OTHERWISE
NOP
END
END
EXIT
_InitAll:
IF show('P','T.H.E.') then DO
address T.H.E. uniconify
address T.H.E. activate
exit
END
IF ~show('L','rexxsupport.library') THEN
IF ~addlib('rexxsupport.library',0,-30,0) THEN
exit(20)
/* Version check */
ca = "THE"
IF SHOWLIST('H', 'AWNPIPE') THEN res=open(ca,"awnpipe:T.H.E./-2042/xc")
if res ~= 1 then do
requesterdata='`requestchoice "T.H.E. Error"
"To use this program you need AWNPipe:*n (Vers 2.42 or newer). " "OK"`'
CALL ShellResult(requesterdata)
exit
end
checkversion = '`version workbench.library`'
IF WORD(ShellResult(checkversion),2) < "44.1414" THEN DO
requesterdata='`requestchoice "T.H.E. Error"
"To use this program you need OS 3.5*n (Vers 44.1414 or newer). " "OK"`'
CALL ShellResult(requesterdata)
EXIT
END
/* Init variables */
TRUE = 1
FALSE = 0
NL = '0a'x
TM_entries = ""
HK_Entries = ""
TM_STRINGNAMEVALUE = ""
TM_STRINGTITLEVALUE = ""
TM_STRINGSHORTCUTVALUE = ""
TM_StringCommandValue = "rexx:"
TM_StringArgumentValue = ""
HK_StringNameValue = ""
HK_StringHotkeyValue = ""
HK_StringCommandValue = "rexx:"
HK_StringArgumentValue = ""
HK_counter = 0
TM_counter = 0
currentpage = 0
Hotkeys = "SHIFT|LSHIFT|RSHIFT|AMIGA|LAMIGA|RAMIGA|ALT|LALT|RALT|ESC|RETURN|DEL|HELP|CTRL|CAPSLOCK|NUMERICPAD|ENTER|BACKSPACE|SPACE|COMMA|UPSTROKE|F1|F2|F3|F4|F5|F6|F7|F8|F10"
/*
** Set current dir
*/
PARSE SOURCE . . . progdir .
booll = LENGTH(progdir)
booli= LASTPOS(":",progdir)
boolh= LASTPOS("/",progdir)
IF boolh > booli THEN progdir = SUBSTR(progdir,1,boolh-1)
IF boolh == 0 THEN progdir = SUBSTR(progdir,1,booli)
IF RIGHT(progdir,1) ~= ':' THEN progdir2 = progdir||'/'
ELSE progdir2 = progdir
CALL PRAGMA('D',progdir)
/*
** Read default strings, open locale.library and catalog
*/
CALL BuildInLanguage /* install build-in language */
IF ~SHOW('LIBRARIES','locale.library') THEN
CALL ADDLIB('locale.library',0,-30,0)
IF SHOW('LIBRARIES','locale.library') THEN DO
id='req'pragma('id') /* get current language */
address command 'rxset' id '`echo $language`'
language=getclip(id)
call setclip(id,'')
IF language ~= '' THEN DO
catalog = OPENCATALOG(progdir2'catalogs/'language'/THE.catalog','english',0)
IF catalog = 0 THEN
catalog = OPENCATALOG(progdir2'THE.catalog','english',0)
END
IF catalog = 0 THEN
catalog = OPENCATALOG('THE.catalog','english',0)
END
RETURN
*/
/*******************************************************************************
** Text aus dem Catalog-File auslesen, falls vorhanden
*******************************************************************************/
localestring:
PARSE ARG stringnumber
IF catalog ~= 0 THEN
RETURN(GETCATALOGSTR(catalog,stringnumber,strings.stringnumber))
ELSE
RETURN(strings.stringnumber)
/*
***
*/
iconify:
IF ARG(1) ~= "" THEN in2 = ARG(1)
IF in2=1 THEN call topipe('id 0 s 32') /* iconify */
ELSE call topipe('id 0 s 64') /* uniconify */
RETURN
keystroke:
call topipe('id 0 s 256')
SELECT
WHEN in2 = 69 THEN IF quickend = "YES" THEN CALL MYEXIT()
WHEN in2 = 76 | in2 = 62 THEN DO /* Cursor up, NUM 8 */
IF currentpage = 0 THEN lister = TM_ListViewID /* ToolsMenu or Hotkey Page? */
ELSE lister = HK_ListViewID
call topipe('id 'lister 'up')
IF currentpage = 0 THEN DO /* ToolsMenu */
IF tm_entries = "" THEN BREAK /* no entries! */
call topipe2('id' TM_ListViewID 'read')
tm_currentnode = WORD(in,3)
TM_currentCounter = FIND(TM_entries,TM_currentnode)
IF TM_currentCounter <= 0 THEN DO
TM_currentCounter = 1
TM_currentNode = WORD(TM_entries,1)
END
ELSE TM_currentnode = WORD(TM_entries,TM_currentCounter)
call _DisableTMGads(FALSE)
CALL _UpdateTMStrings(TM_currentnode)
END
ELSE DO /* Hotkey Menu */
IF hk_entries = "" THEN BREAK /* no entries! */
call topipe2('id' HK_ListViewID 'read')
hk_currentnode = WORD(in,3)
HK_currentCounter=FIND(HK_entries,HK_currentNode)
IF HK_currentCounter <= 0 THEN DO
HK_currentCounter = 1
HK_currentNode = WORD(HK_entries,1)
END
ELSE HK_currentnode = WORD(HK_entries,HK_currentCounter)
call _DisableHKGads(FALSE)
CALL _UpdateHKStrings(HK_currentnode)
END
END
WHEN in2 = 77 | in2 = 30 THEN DO /* Cursor down, NUM 2 */
IF currentpage = 0 THEN lister = TM_ListViewID /* ToolsMenu or Hotkey Page? */
ELSE lister = HK_ListViewID
call topipe('id 'lister 'down')
IF currentpage = 0 THEN DO /* ToolsMenu */
IF tm_entries = "" THEN BREAK /* no entries! */
call topipe2('id' TM_ListViewID 'read')
tm_currentnode = WORD(in,3)
TM_currentCounter=FIND(TM_entries,TM_currentNode)
IF TM_currentCounter <= 0 THEN DO
TM_currentCounter = 1
TM_currentNode = WORD(TM_entries,1)
END
ELSE DO
TM_currentnode = WORD(TM_entries,TM_currentCounter)
IF TM_Name.TM_currentnode = "TM_NAME." THEN DO
TM_currentCounter = TM_currentCounter -1
TM_currentnode = WORD(TM_entries,TM_currentCounter)
END
END
call _DisableTMGads(FALSE)
CALL _UpdateTMStrings(TM_currentnode)
END
ELSE DO /* Hotkey Menu */
IF hk_entries = "" THEN BREAK /* no entries! */
call topipe2('id' hk_ListViewID 'read')
hk_currentnode = WORD(in,3)
HK_currentCounter=FIND(HK_entries,hk_currentNode)
IF HK_currentCounter <= 0 THEN DO
HK_currentCounter = 1
HK_currentNode = WORD(HK_entries,1)
END
ELSE DO
HK_currentnode = WORD(HK_entries,HK_currentCounter)
IF HK_Name.HK_currentnode = "HK_NAME." THEN DO
HK_currentCounter = HK_currentCounter -1
HK_currentnode = WORD(HK_entries,HK_currentCounter)
END
END
call _DisableHKGads(FALSE)
CALL _UpdateHKStrings(HK_currentnode)
END
END
WHEN in2 = 66 THEN DO /* TAB */
currentpage=bitxor('1'x,currentpage)
call topipe('id' pageid 's' currentpage 'refresh')
END
WHEN in2 = 61 THEN DO /* Home */
IF currentpage = 0 THEN DO
lister = TM_ListViewID /* ToolsMenu or Hotkey Page? */
call topipe2('id' TM_ListViewID 'read')
check = WORD(in,3)
LPos=WORD(tm_entries,1)
IF Lpos ~= check THEN DO
call _DisableTMGads(FALSE)
CALL _UpdateTMStrings(LPos)
call topipe('id' lister 's' lpos)
TM_currentnode = LPos
END
END
ELSE DO
lister = HK_ListViewID
call topipe2('id' HK_ListViewID 'read')
check = WORD(in,3)
LPos=WORD(hk_entries,1)
IF Lpos ~= check THEN DO
call _DisableHKGads(FALSE)
CALL _UpdateHKStrings(LPos)
call topipe('id' lister 's' lpos)
HK_currentnode = LPos
END
END
END
WHEN in2 = 29 THEN DO /* End */
IF currentpage = 0 THEN DO
call topipe2('id' TM_ListViewID 'read')
check = WORD(in,3)
lister = TM_ListViewID /* ToolsMenu or Hotkey Page? */
LPos=WORD(tm_entries,WORDS(tm_entries))
IF Lpos ~= check THEN DO
call _DisableTMGads(FALSE)
CALL _UpdateTMStrings(LPos)
call topipe('id' lister 's' lpos)
TM_currentnode = LPos
END
END
ELSE DO
lister = HK_ListViewID
call topipe2('id' HK_ListViewID 'read')
check = WORD(in,3)
LPos=WORD(hk_entries,WORDS(hk_entries))
IF Lpos ~= check THEN DO
call _DisableHKGads(FALSE)
CALL _UpdateHKStrings(LPos)
call topipe('id' lister 's' lpos)
HK_currentnode = LPos
END
END
END
OTHERWISE
NOP
END
call topipe('id 0 s 512')
RETURN
menu:
SELECT
WHEN in2 = 0 & in3 = 0 THEN DO
call topipe('id 0 s 256')
requesterdata='`requestchoice "RA_THEinfo" "RA_THE.rexx 1.4 (7.4.00)*n© by Nils Görs*n<nils@goers.line.org>*n*nGUI build with AWNPipe*n© by William Parker*n<bill@amitrix.com>" "OK"`'
CALL ShellResult(requesterdata)
call topipe('id 0 s 512')
END
WHEN in2 = 0 & in3 = 2 THEN DO
call topipe('id 0 s 256')
requesterdata='`requestchoice "T.H.E." "'localestring(MSG_Request_Quit)'" "'localestring(MSG_Request_Yes)'" PUBSCREEN='pubscreen'`'
IF ShellResult(requesterdata) = 1 THEN CALL MYEXIT
call topipe('id 0 s 512')
END
WHEN in2 = 1 & in3 = 0 THEN DO
IF currentpage = 0 THEN call _DisableTMGads(TRUE)
ELSE call _DisableHKGads(TRUE)
call topipe('id 0 s 256')
IF currentpage = 1 THEN DO
IF hk_counter >0 THEN DO
call topipe('id' HK_ListviewID 'removenode')
CALL HKClearStrings()
hk_entries = ""
hk_counter = 0
END
END
ELSE DO
IF tm_counter >0 THEN DO
call topipe('id' TM_ListviewID 'removenode')
CALL TMClearStrings()
tm_entries = ""
tm_counter = 0
END
END
call topipe('id 0 s 512')
END
WHEN in2 = 1 & in3 = 1 THEN DO /* last saved */
call topipe('id 0 s 256')
IF currentpage = 0 THEN DO
call _DisableTMGads(TRUE)
call _UpdateTMStrings(TM_currentnode)
call topipe('id' TM_ListviewID 'removenode')
tm_entries = ""
tm_counter = 0
call topipe('id' TM_ListviewID 'Selected=0') /* Disable selected entry */
TM_currentNode = 0 /* Set pointer to first list entry */
call GetToolsMenu()
END
ELSE DO
call _DisableHKGads(TRUE)
call _UpdateHKStrings(HK_currentnode)
call topipe('id' HK_ListviewID 'removenode')
hk_entries = ""
hk_counter = 0
call topipe('id' HK_ListviewID 'Selected=0') /* Disable selected entry */
HK_currentNode = 0 /* Set pointer to first list entry */
call GetHotkeys()
END
call topipe('id 0 s 512')
END
OTHERWISE
NOP
END
RETURN
Gadget:
SELECT
/*
*** ListView
*/
WHEN in2 = pageid THEN currentpage = in3
WHEN in2 = TM_ListViewID THEN DO
TM_currentnode=in5 /* remember the curently selected node for future use...*/
CALL _DisableTMGads(FALSE)
CALL _UpdateTMStrings(in5)
END
WHEN in2 = HK_ListViewID THEN DO
HK_currentnode=in5 /* remember the curently selected node for future use...*/
IF FIND(HK_entries,HK_currentnode) = 0 THEN RETURN
IF HK_Key.in5 = "" THEN HK_HotkeyValue = ""
ELSE HK_HotkeyValue = HK_Key.in5
call _DisableHKGads(FALSE)
CALL _UpdateHKStrings(in5)
END
/*
*** ToolsMenu Gadgets
*/
WHEN in2 = TM_AddID THEN DO
IF TM_Counter = 62 THEN DO
call topipe('id 0 s 256')
requesterdata='`requestchoice "T.H.E." "'localestring(MSG_TooManyEntries)'" "Ok!" PUBSCREEN='pubscreen'`'
CALL ShellResult(requesterdata)
call topipe('id 0 s 512')
RETURN
END
currentPos=FIND(TM_entries,TM_currentnode)
currentPos.bak = currentPos
IF currentpos ~= 0 THEN tarGID= WORD(tm_entries,currentpos.bak)
ELSE tarGID = -1
Node_ID = topipe('tar='tarGID 'id 'TM_ListViewID 'addnode gt "'localestring(MSG_New_Name)'|'localestring(MSG_New_Title)'||rexx:" page 'pageid)
TM_name.Node_ID = localestring(MSG_New_Name)
TM_title.Node_ID = localestring(MSG_New_Title)
TM_Shortcut.Node_ID = ""
mt_Command = "rexx:"
mt_Args = ""
call parseTMArgs() /* write command and args */
TM_CURRENTNODE=Node_ID
IF currentPos ~= 0 & currentPos < TM_counter THEN DO
currentPos = WORDINDEX(TM_entries,currentpos+1)-1 /* next entry and char back */
tm_entries = INSERT(TM_currentnode||" ",tm_entries,currentPos)
END
ELSE TM_Entries = TM_Entries Node_ID /* add GID to TM_entries */
TM_counter = TM_counter + 1 /* one more entry in list! */
call topipe2('id 'TM_ListViewID' s 'TM_CURRENTNODE)
CALL _DisableTMGads(FALSE)
CALL _UpdateTMStrings(TM_CURRENTNODE)
/*
call topipe('id 'TM_StringNameID' s=0') /* auto activation forces system-crash */
*/
END
WHEN in2 = TM_RemoveID THEN DO
IF TM_currentnode = "TM_CURRENTNODE" THEN RETURN
IF topipe2('id 'TM_currentnode' address') = 0 THEN RETURN /* check if GID exists */
CALL _DisableTMGads(TRUE)
CALL topipe('id' TM_currentnode 'removenode')
CALL TMClearStrings()
TM_counter = TM_counter - 1
TM_entries = DELWORD(TM_entries,FIND(TM_entries,TM_currentnode),1)
END
WHEN in2 = TM_CloneID THEN DO
IF TM_Counter = 62 THEN DO
call topipe('id 0 s 256')
requesterdata='`requestchoice "T.H.E." "'localestring(MSG_TooManyEntries)'" "Ok!" PUBSCREEN='pubscreen'`'
CALL ShellResult(requesterdata)
call topipe('id 0 s 512')
RETURN
END
IF TM_currentnode = "TM_CURRENTNODE" THEN RETURN /* no selected enty */
IF topipe2('id 'TM_currentnode' address') = 0 THEN RETURN /* check if GID exists */
currentPos=FIND(TM_entries,TM_currentnode)
tarGID = WORD(tm_entries,FIND(TM_entries,TM_currentnode))
TM_CommandArgs = STRIP(TM_Command.tarGID TM_Args.tarGID)
Node_ID = topipe('tar='tarGID 'id 'TM_ListViewID 'addnode gt "'TM_name.tarGID'|'TM_title.tarGID'|'TM_Shortcut.tarGID'|'TM_CommandArgs '"page 'pageid)
TM_name.Node_ID = TM_name.tarGID
TM_title.Node_ID = TM_title.tarGID
TM_Shortcut.Node_ID = TM_Shortcut.tarGID
TM_Command.Node_ID = TM_Command.tarGID
TM_Args.Node_ID = TM_Args.tarGID
TM_CURRENTNODE=Node_ID
IF currentPos ~= 0 & currentPos < TM_counter THEN DO
currentPos = WORDINDEX(TM_entries,currentpos+1)-1 /* next entry and char back */
tm_entries = INSERT(TM_currentnode||" ",tm_entries,currentPos)
END
ELSE TM_Entries = TM_Entries Node_ID /* add GID to TM_entries */
TM_counter = TM_counter + 1 /* one more entry in list! */
call topipe2('id 'TM_ListViewID' s 'TM_CURRENTNODE)
CALL _UpdateTMStrings(TM_CURRENTNODE)
END
WHEN in2 = TM_UpID THEN DO
IF TM_CURRENTNODE = "TM_CURRENTNODE" THEN RETURN
IF topipe2('id 'TM_currentnode' address') = 0 THEN RETURN /* check if GID exists */
currentPos = FIND(TM_entries,TM_currentnode)
prevEntry = WORD(TM_entries,currentPos-1) /* get previous entry */
IF prevEntry = "" THEN RETURN /* Top of list */
CALL swapTM
TM_CURRENTNODE = prevEntry
call topipe2('id 'TM_ListViewID' s 'TM_CURRENTNODE)
CALL _UpdateTMStrings(TM_currentnode)
END
WHEN in2 = TM_DownID THEN DO
IF TM_CURRENTNODE = "TM_CURRENTNODE" THEN RETURN
IF topipe2('id 'TM_currentnode' address') = 0 THEN RETURN /* check if GID exists */
currentPos = FIND(TM_entries,TM_currentnode)
prevEntry = WORD(TM_entries,currentPos+1) /* get previous entry */
IF prevEntry = "" THEN RETURN /* Top of list */
CALL swapTM
TM_CURRENTNODE = prevEntry
call topipe2('id 'TM_ListViewID' s 'TM_CURRENTNODE)
CALL _UpdateTMStrings(TM_currentnode)
END
/*
*** get StringGadget value for Tools-Menu
*/
WHEN in2 = TM_StringNameID THEN DO
IF TM_currentnode = "TM_CURRENTNODE" THEN TM_currentnode = -1
TM_StringNameValue = DELWORD(in,1,2)
IF TM_Args.TM_currentnode ~= "" THEN commandArgs = TM_Command.TM_currentnode TM_Args.TM_currentnode
ELSE commandArgs = TM_Command.TM_currentnode||TM_Args.TM_currentnode
IF topipe2('id 'TM_currentnode' address') ~= 0 THEN /* check if GID exists */
call topipe('id 'TM_currentnode' gt "'TM_StringNameValue'|'TM_title.TM_currentnode'|'TM_ShortCut.TM_currentnode'|'commandArgs'"')
TM_Name.TM_currentnode = TM_StringNameValue
END
WHEN in2 = TM_StringTitleID THEN DO
IF TM_currentnode = "TM_CURRENTNODE" THEN TM_currentnode = -1
TM_StringTitleValue = DELWORD(in,1,2)
IF TM_Args.TM_currentnode ~= "" THEN commandArgs = TM_Command.TM_currentnode TM_Args.TM_currentnode
ELSE commandArgs = TM_Command.TM_currentnode||TM_Args.TM_currentnode
IF topipe2('id 'TM_currentnode' address') ~= 0 THEN /* check if GID exists */
call topipe('id 'TM_currentnode' gt "'TM_Name.TM_currentnode'|'TM_StringTitleValue'|'TM_ShortCut.TM_currentnode'|'commandArgs'"')
TM_Title.TM_currentnode = TM_StringTitleValue
END
WHEN in2 = TM_StringShortcutID THEN DO
IF TM_currentnode = "TM_CURRENTNODE" THEN TM_currentnode = -1
IF in3 = '"' THEN in3 = "" /* don't except " as Shortcut! */
/*
IF LENGTH(in3) > 0 THEN in3 = LEFT(in3,1)
ELSE in3 = ""
*/
TM_StringShortcutValue = in3
IF TM_Args.TM_currentnode ~= "" THEN commandArgs = TM_Command.TM_currentnode TM_Args.TM_currentnode
ELSE commandArgs = TM_Command.TM_currentnode||TM_Args.TM_currentnode
IF topipe2('id 'TM_currentnode' address') ~= 0 THEN /* check if GID exists */
call topipe('id 'TM_currentnode' gt "'TM_Name.TM_currentnode'|'TM_title.TM_currentnode'|'TM_StringShortCutValue'|'commandArgs'"')
call topipe('id 'TM_StringShortCutID 'gt "'TM_StringShortcutValue'" ref')
TM_ShortCut.TM_currentnode = TM_StringShortCutValue
END
WHEN in2 = TM_GetFileID THEN DO
IF TM_currentnode = "TM_CURRENTNODE" THEN TM_currentnode = -1
TM_StringCommandValue = STRIP(COMPRESS(DELWORD(in,1,3),'"'))
IF TM_Args.TM_currentnode ~= "" THEN commandArgs = TM_StringCommandValue TM_Args.TM_currentnode
ELSE commandArgs = TM_StringCommandValue||TM_Args.TM_currentnode
IF topipe2('id 'TM_currentnode' address') ~= 0 THEN /* check if GID exists */
call topipe('id 'TM_currentnode' gt "'TM_Name.TM_currentnode'|'TM_title.TM_currentnode'|'TM_ShortCut.TM_currentnode'|'commandArgs'"')
TM_Command.TM_currentnode = TM_StringCommandValue
END
WHEN in2 = TM_StringArgsID THEN DO
IF TM_currentnode = "TM_CURRENTNODE" THEN TM_currentnode = -1
TM_StringArgsValue = STRIP(COMPRESS(DELWORD(in,1,2),'"'))
IF TM_StringArgsValue ~= "" THEN commandArgs = TM_Command.TM_currentnode TM_StringArgsValue
ELSE commandArgs = TM_Command.TM_currentnode||TM_StringArgsValue
IF topipe2('id 'TM_currentnode' address') ~= 0 THEN /* check if GID exists */
call topipe('id 'TM_currentnode' gt "'TM_Name.TM_currentnode'|'TM_title.TM_currentnode'|'TM_ShortCut.TM_currentnode'|'commandArgs'"')
TM_Args.TM_currentnode = TM_StringArgsValue
END
/*
*** Hotkey Gadgets
*/
WHEN in2 = HK_AddID THEN DO
Node_ID = topipe('id 'HK_ListViewID 'addnode gt "'localestring(MSG_New_Name)'|'localestring(MSG_New_Hotkey)'|rexx:" page 'pageid)
hk_Name = localestring(MSG_New_Name)
hk_key = ""
hk_Command = "rexx:"
CALL WriteHKStem()
HK_CURRENTNODE=Node_ID
call topipe2('id 'HK_ListViewID' s 'HK_CURRENTNODE)
call _DisableHKGads(FALSE)
CALL _UpdateHKStrings(HK_CURRENTNODE)
IF HK_Key.HK_CURRENTNODE = "" THEN HK_HotkeyValue = ""
ELSE HK_HotkeyValue = HK_Key.HK_CURRENTNODE
/*
call topipe('id 'HK_StringNameID' s=0') /* auto activation forces system-crash */
*/
END
WHEN in2 = HK_CloneID THEN DO
IF HK_currentnode = "HK_CURRENTNODE" THEN RETURN /* no selected enty */
IF topipe2('id 'HK_currentnode' address') = 0 THEN RETURN /* check if GID exists */
currentPos=FIND(HK_entries,HK_currentnode)
tarGID = word(HK_entries,FIND(HK_entries,HK_currentnode))
HK_CommandArgs = STRIP(HK_Command.tarGID HK_Args.tarGID)
Node_ID = topipe('tar='tarGID 'id 'HK_ListViewID 'addnode gt "'HK_name.tarGID'|'HK_key.tarGID'|'HK_CommandArgs '"page 'pageid)
HK_name.Node_ID = HK_name.tarGID
HK_key.Node_ID = HK_Key.tarGID
HK_Command.Node_ID = HK_Command.tarGID
HK_Args.Node_ID = HK_Args.tarGID
HK_CURRENTNODE=Node_ID
IF currentPos ~= 0 & currentPos < HK_counter THEN DO
currentPos = WORDINDEX(HK_entries,currentpos+1)-1 /* next entry and char back */
HK_entries = INSERT(HK_currentnode||" ",HK_entries,currentPos)
END
ELSE HK_Entries = HK_Entries Node_ID /* add GID to HK_entries */
HK_counter = HK_counter + 1 /* one more entry in list! */
call topipe2('id 'HK_ListViewID' s 'HK_CURRENTNODE)
CALL _UpdateHKStrings(HK_CURRENTNODE)
END
WHEN in2 = HK_RemoveID THEN DO
IF HK_currentnode = "HK_CURRENTNODE" THEN RETURN
IF topipe2('id 'HK_currentnode' address') = 0 THEN RETURN /* check if GID exists */
CALL topipe('id' HK_currentnode 'removenode')
call _DisableHKGads(TRUE)
CALL HKClearStrings()
HK_counter = HK_counter - 1
HK_entries = DELWORD(HK_entries,FIND(HK_entries,HK_currentnode),1)
END
/*
*** get Stringgadget value for Hotkeys
*/
WHEN in2 = HK_StringNameID THEN DO
IF HK_currentnode = "HK_CURRENTNODE" THEN HK_currentnode = -1
HK_StringNameValue = DELWORD(in,1,2)
IF HK_Args.HK_currentnode ~= "" THEN commandArgs = HK_Command.HK_currentnode HK_Args.HK_currentnode
ELSE commandArgs = HK_Command.HK_currentnode||HK_Args.HK_currentnode
IF topipe2('id 'HK_currentnode' address') ~= 0 THEN /* check if GID exists */
call topipe('id 'HK_currentnode' gt "'HK_StringNameValue'|'HK_Key.HK_currentnode'|'commandArgs'"')
HK_Name.HK_currentnode = HK_StringNameValue
END
WHEN in2 = HK_CancelBoxID THEN DO
IF HK_currentnode = "HK_CURRENTNODE" THEN HK_currentnode = -1
call topipe('id 'HK_StringHotKeyID 'gt "" ref')
IF topipe2('id 'HK_currentnode' address') ~= 0 THEN DO/* check if GID exists */
call topipe('id 'HK_currentnode' gt "'HK_name.HK_currentnode'|""|'commandArgs'"')
HK_Key.HK_currentnode = ""
END
HK_StringHotkeyValue = ""
END
WHEN in2 = HK_StringHotKeyID THEN DO
in3 = DELWORD(in,1,2)
IF HK_currentnode = "HK_CURRENTNODE" THEN HK_currentnode = -1
IF in3 = "" THEN HK_StringHotkeyValue = ""
ELSE HK_StringHotkeyValue = in3
IF HK_Args.HK_currentnode ~= "" THEN commandArgs = HK_Command.HK_currentnode HK_Args.HK_currentnode
ELSE commandArgs = HK_Command.HK_currentnode||HK_Args.HK_currentnode
call topipe('id 'HK_StringHotKeyID' gt "'HK_StringHotkeyValue'" ref')
IF topipe2('id 'HK_currentnode' address') ~= 0 THEN /* check if GID exists */
call topipe('id 'HK_currentnode' gt "'HK_name.HK_currentnode'|'HK_StringHotkeyValue'|'commandArgs'"')
HK_Key.HK_currentnode = HK_StringHotKeyValue
END
WHEN in2 = HK_chooserID THEN DO
addHotkey = WORD(TRANSLATE(Hotkeys," ","|"),in3+1)
IF HK_currentnode ~= "HK_CURRENTNODE" & HK_currentnode ~= -1 THEN HK_StringHotkeyValue = HK_Key.HK_currentnode
ELSE HK_CURRENTNODE = -1
IF HK_StringHotkeyValue = "" THEN HK_StringHotkeyValue = addhotkey
ELSE HK_StringHotkeyValue = HK_StringHotkeyValue ||" "|| addHotkey
IF HK_Args.HK_currentnode ~= "" THEN commandArgs = HK_Command.HK_currentnode HK_Args.HK_currentnode
ELSE commandArgs = HK_Command.HK_currentnode||HK_Args.HK_currentnode
call topipe('id 'HK_StringHotKeyID 'gt "'HK_StringHotkeyValue'"')
IF topipe2('id 'HK_currentnode' address') ~= 0 THEN /* check if GID exists */
call topipe('id 'HK_currentnode' gt "'HK_Name.HK_currentnode'|'HK_StringHotkeyValue'|'commandArgs'"')
HK_Key.HK_currentnode = HK_StringHotKeyValue
END
WHEN in2 = HK_GetFileID THEN DO
IF HK_currentnode = "HK_CURRENTNODE" THEN HK_currentnode = -1
HK_StringCommandValue = STRIP(COMPRESS(DELWORD(in,1,3),'"'))
IF HK_Args.HK_currentnode ~= "" THEN commandArgs = HK_StringCommandValue HK_Args.HK_currentnode
ELSE commandArgs = HK_StringCommandValue||HK_Args.HK_currentnode
IF topipe2('id 'HK_currentnode' address') ~= 0 THEN /* check if GID exists */
call topipe('id 'HK_currentnode' gt "'HK_Name.HK_currentnode'|'HK_Key.HK_currentnode'|'commandArgs'"')
HK_Command.HK_currentnode = HK_StringCommandValue
END
WHEN in2 = HK_StringArgsID THEN DO
IF HK_currentnode = "HK_CURRENTNODE" THEN HK_currentnode = -1
HK_StringArgsValue = STRIP(COMPRESS(DELWORD(in,1,2),'"'))
IF HK_StringArgsValue ~= "" THEN commandArgs = HK_Command.HK_currentnode HK_StringArgsValue
ELSE commandArgs = HK_Command.HK_currentnode||HK_StringArgsValue
IF topipe2('id 'HK_currentnode' address') ~= 0 THEN /* check if GID exists */
call topipe('id 'HK_currentnode' gt "'HK_Name.HK_currentnode'|'HK_Key.HK_currentnode'|'commandArgs'"')
HK_Args.HK_currentnode = HK_StringArgsValue
END
/*
*** Save|Use|Cancel gadgets
*/
WHEN in2 = TM_SaveID | in2 = HK_SaveID THEN DO
CALL _Save
CALL _RemoveMenuHotkeys
RX scriptname
CALL MYEXIT
END
WHEN in2 = TM_UseID | in2 = HK_UseID THEN DO
CALL _RemoveMenuHotkeys
Scriptname.bak = Scriptname
Scriptname = "t:myscript"
CALL _Save
RX scriptname
IF exists(scriptname) THEN DELETE scriptname
Scriptname = Scriptname.bak
CALL MYEXIT
END
WHEN in2 = TM_CancelID | in2 = HK_CancelID THEN CALL MYEXIT()
OTHERWISE
NOP
END
return
BuildGUI:
/* define window */
call topipe('Title="'localestring(MSG_TitleName)'" st="Workbench Screen" Icontitle=THE iconifygadget sendkeys defaultgadgets modify verticaly SpaceInner SpaceOuter topleft activate ii "'called'" pubscreen='pubscreen)
call topipe('ARexx gt "T.H.E.|uniconify|iconify|quit|activate|front|back"')
/* define the menues */
call topipe('menu gt "'localestring(MSG_MenuT_Project)'|'localestring(MSG_Menu_About)'|-|'localestring(MSG_Menu_Quit)'"')
call topipe('menu gt "'localestring(MSG_MenuT_Edit)'|'localestring(MSG_Menu_Remove)'|'localestring(MSG_Menu_LastSaved)'"')
/* define the gadgets*/
pageid = topipe('clicktab ctl "'localestring(MSG_MAIN_ToolsMenu)'|'localestring(MSG_MAIN_HotkeyMenu)'"')
call topipe('layout b=0 v page' pageid)
call topipe('layout si so b=7 gt="'localestring(MSG_TM_ToolsMenu)'"')
IF horizLine = "YES" THEN TM_ListViewID = topipe('listbrowser lbl="'localestring(MSG_TM_LV_Title)'" arrows h v minh=120 minw=300 showtitles')
ELSE TM_ListViewID = topipe('listbrowser lbl="'localestring(MSG_TM_LV_Title)'" arrows v minh=120 minw=300 showtitles')
call topipe(le)
call topipe('layout hori so b=0 weih=0')
TM_AddID = topipe('button gt "'localestring(MSG_Button_Add)'"')
TM_RemoveID = topipe('button gt "'localestring(MSG_Button_Remove)'" dis=1')
TM_CloneID = topipe('button gt "'localestring(MSG_Button_Clone)'" dis=1')
TM_UpID = topipe('button gt "'localestring(MSG_Button_Up)'" dis=1')
TM_DownID = topipe('button gt "'localestring(MSG_Button_Down)'" dis=1')
call topipe(le)
call topipe('layout v si so weih 0')
call topipe('label gt "'localestring(MSG_String_Name)'" ua')
TM_StringNameID = topipe('string chl lj tc dis=1')
call topipe('label gt "'localestring(MSG_String_Title)'" ua')
TM_StringTitleID = topipe('string chl lj tc dis=1')
call topipe('label gt "'localestring(MSG_String_ShortCut)'" ua')
TM_StringShortCutID = topipe('string chl lj tc maxchars=2 dis=1')
call topipe('label gt "'localestring(MSG_String_Command)'" ua')
TM_GetFileID = topipe('getfile chl fn "rexx:" dis=1')
call topipe('label gt "'localestring(MSG_String_Argument)'" ua')
TM_StringArgsID = topipe('string chl lj tc dis=1 maxchars='mxchars)
call topipe(le)
call topipe('layout b=0 v si so weih 0')
call topipe('button b=7 minh 2')
call topipe('layout b=0 h si so weih 0')
TM_SaveID = topipe('button weiw 0 gt "'localestring(MSG_Button_Save)'"')
call topipe('space')
TM_UseID = topipe('button weiw 0 gt "'localestring(MSG_Button_Use)'"')
call topipe('space')
TM_CancelID = topipe('button weiw 0 gt "'localestring(MSG_Button_Cancel)'"')
call topipe(le)
call topipe(le)
call topipe(le)
call topipe('layout b 0 v page' pageid)
call topipe('layout si so b=7 gt="'localestring(MSG_HK_Hotkey)'"')
IF horizLine = "YES" THEN HK_ListViewID = topipe('listbrowser lbl="'localestring(MSG_HK_LV_Title)'" arrows h v minh=120 minw=300 showtitles')
ELSE HK_ListViewID = topipe('listbrowser lbl="'localestring(MSG_HK_LV_Title)'" arrows v minh=120 minw=300 showtitles')
call topipe(le)
call topipe('layout hori so b=0 weih=0')
HK_AddID = topipe('button gt "'localestring(MSG_Button_Add)'"')
call topipe('space')
HK_CloneID = topipe('button gt "'localestring(MSG_Button_Clone)'" dis=1')
call topipe('space')
HK_RemoveID = topipe('button gt "'localestring(MSG_Button_Remove)'" dis=1')
call topipe(le)
call topipe('layout v si so weih 0')
call topipe('label gt "'localestring(MSG_String_Name)'" ua')
HK_StringNameID = topipe('string chl lj tc dis=1')
call topipe('label gt "'localestring(MSG_String_HotKey)'" ua')
call topipe('layout chl bj b=0')
HK_StringHotKeyID = topipe('string chl lj tc dis=1')
HK_CancelBoxID = topipe('button autobutton=4 weiw=0 dis=1')
HK_ChooserID = topipe('chooser chl lj maxn=31 dis=1 cl='hotkeys)
call topipe('le')
call topipe('label gt "'localestring(MSG_String_Command)'" ua')
HK_GetFileID = topipe('getfile chl fn "rexx:" dis=1')
call topipe('label gt "'localestring(MSG_String_Argument)'" ua')
HK_StringArgsID = topipe('string chl lj tc dis=1 maxchars='mxchars)
call topipe(le)
call topipe('layout b=0 v si so weih 0')
call topipe('button b=7 minh 2')
call topipe('layout b=0 h si so weih 0')
HK_SaveID = topipe('button weiw 0 gt "'localestring(MSG_Button_Save)'"')
call topipe('space')
HK_UseID = topipe('button weiw 0 gt "'localestring(MSG_Button_Use)'"')
call topipe('space')
HK_CancelID = topipe('button weiw 0 gt "'localestring(MSG_Button_Cancel)'"')
call topipe(le)
call topipe(le)
call topipe('commodity cxname T.H.E. cxtitle="T.H.E. (c) by Nils Görs" cxdesc="'localestring(MSG_TitleName)' unique cxhotkey="ctrl alt t"')
/*open the GUI window*/
call topipe("open")
/* now create the listview entries */
call topipe('id 0 s 256')
call GetToolsMenu()
call GetHotkeys()
call topipe('id 0 s 512')
RETURN
topipe:
/* this routine does error checking on lines written to pipe.*/
/*get line to output*/
parse arg out
/* write to the pipe*/
call writeln(ca,out)
/*get responce and parse it.*/
in=readln(ca)
parse var in res1 res2 .
/* if all is ok return the second part of the responce (usualy the GID)*/
if res1='ok' then return(res2)
/* something went wrong, we notify the user then exit */
/*show problem line and responce (reponce may be just a blank line)*/
say 'error from: 'out
say ' responce: ' in
exit
topipe2:
/* this routine does error checking on lines written to pipe.*/
/*get line to output*/
parse arg out
/* write to the pipe*/
call writeln(ca,out)
/*get responce and parse it.*/
in=readln(ca)
parse var in res1 res2 .
return(res1)
/*
my very personal ARexx host
*/
RxHost:
call topipe2("rc 0")
SELECT
WHEN in2 = 0 THEN call topipe('id 0 s 64') /* uniconify */
WHEN in2 = 1 THEN call topipe('id 0 s 32') /* iconify */
WHEN in2 = 2 THEN CALL MYEXIT(0) /* quit */
WHEN in2 = 3 THEN call topipe('id 0 s 1') /* activate */
WHEN in2 = 4 THEN call topipe('id 0 s 2') /* window to front */
WHEN in2 = 5 THEN call topipe('id 0 s 4') /* window to back */
OTHERWISE
call topipe2("rc 5")
END
RETURN
/* my very own commodity */
commodity:
SELECT
WHEN in2='show' then call iconify(0)
WHEN in2='hide' then call iconify(1)
WHEN in2='kill' then EXIT
WHEN in2='hotkey' then call iconify(0)
OTHERWISE
END
RETURN
MyExit:
CALL CLOSECATALOG(catalog)
EXIT
/*
*/
GetToolsMenu:
GETATTR MENUCOMMANDS.COUNT
ToolsMenu.0 = result
call topipe('id 'TM_ListViewID 'list 0')
DO i = 0 to ToolsMenu.0 -1
GETATTR MENUCOMMANDS.i.NAME
mt_name = result
GETATTR MENUCOMMANDS.i.TITLE
mt_title = result
GETATTR MENUCOMMANDS.i.SHORTCUT
mt_shortcut = result
GETATTR MENUCOMMANDS.i.COMMAND
mt_command = result
/* get the GID of the node, save the contents of the node for further reference. */
Node_ID = topipe('id 'TM_ListViewID 'addnode gt "'mt_name'|'mt_title'|'mt_shortcut'|'mt_command'" page 'pageid)
CALL WriteTMStem()
END
call topipe('id 'TM_ListViewID 'list 1 page' pageid)
RETURN
GetHotkeys:
GETATTR KEYCOMMANDS.COUNT
Hotkeys.0 = result
call topipe('id 'HK_ListViewID 'list 0')
DO i = 0 to Hotkeys.0 -1
GETATTR KEYCOMMANDS.i.NAME
hk_name = result
GETATTR KEYCOMMANDS.i.KEY
hk_key = result
GETATTR KEYCOMMANDS.i.COMMAND
hk_command = result
/* get the GID of the node, save the contents of the node for further reference. */
Node_ID = topipe('id 'HK_ListViewID 'addnode gt "'hk_name'|'hk_key'|'hk_command'" page 'pageid)
call writeHKStem()
END
call topipe('id 'HK_ListViewID 'list 1 page' pageid)
RETURN
WriteTMStem:
TM_name.Node_ID=mt_name
TM_title.Node_ID=mt_title
TM_Shortcut.Node_ID=mt_shortcut
call parseTMArgs() /* write command and args */
TM_counter = TM_counter + 1
TM_Entries = TM_Entries Node_ID /* add GID to TM_entries */
RETURN
TMClearStrings:
CALL topipe('id 'TM_StringNameID ' dis='TMGadStatus 'gt ""')
CALL topipe('id 'TM_StringTitleID' dis='TMGadStatus 'gt ""')
CALL topipe('id 'TM_StringShortCutID' dis='TMGadStatus 'gt ""')
CALL topipe('id 'TM_GetFileID' dis='TMGadStatus 'fn "rexx:"')
CALL topipe('id 'TM_StringArgsID' dis='TMGadStatus 'gt ""')
TM_StringNameValue = ""
TM_StringTitleValue = ""
TM_StringShortcutValue = ""
TM_StringCommandValue = "rexx:"
TM_StringArgsValue = ""
RETURN
WriteHKStem:
HK_Name.Node_ID = HK_name
HK_Key.Node_ID = HK_Key
call parseHKArgs() /* write command and args */
HK_counter = HK_counter + 1
HK_Entries = HK_Entries Node_ID /* add GID to HK_entries */
RETURN
HKClearStrings:
CALL topipe('id 'HK_StringNameID 'dis='HKGadStatus 'gt ""')
CALL topipe('id 'HK_StringHotKeyID 'dis='HKGadStatus 'gt ""')
CALL topipe('id 'HK_GetFileID 'dis='HKGadStatus 'fn "rexx:"')
CALL topipe('id 'HK_StringArgsID 'dis='HKGadStatus 'gt ""')
call topipe('id 'HK_GetFileID' dis='HKGadStatus)
HK_StringNameValue = ""
HK_StringHotKeyValue = ""
HK_StringCommandValue = "rexx:"
HK_StringArgsValue = ""
RETURN
_Save:
IF TM_counter = 0 & HK_counter = 0 THEN RETURN
CALL OPEN(file,scriptname,write)
CALL WRITELN(file,"/*"localestring(MSG_Created)" T.H.E.*/"||NL||"ADDRESS WORKBENCH")
IF HK_counter >0 THEN DO
DO i = 1 to WORDS(HK_entries)
val = WORD(HK_entries,i)
IF HK_Args.val ~= "" THEN commandArgs = HK_Command.val HK_Args.val
ELSE commandArgs = HK_Command.val||HK_Args.val
commandArgs = STRIP(commandArgs,B)
CALL WRITELN(file,KEYBOARD ADD NAME '''"'||HK_Name.val||'"''' KEY '''"'||HK_Key.val||'"''' CMD '"'||commandArgs||'"')
END
END
IF TM_counter >0 THEN DO
CALL WRITELN(file,"")
DO i = 1 to WORDS(tm_entries)
val = WORD(tm_entries,i)
IF TM_Args.val ~= "" THEN commandArgs = TM_Command.val TM_Args.val
ELSE commandArgs = TM_Command.val||TM_Args.val
commandArgs = STRIP(commandArgs,B)
IF TM_Shortcut.val = "" THEN CALL WRITELN(file,MENU ADD NAME '''"'||TM_name.val||'"''' TITLE '''"'||TM_title.val||'"''' CMD '"'||commandArgs||'"')
ELSE CALL WRITELN(file,MENU ADD NAME '''"'||TM_name.val||'"''' TITLE '''"'||TM_title.val||'"''' SHORTCUT '"'||TM_Shortcut.val||'"' CMD '"'||commandArgs||'"')
END
END
CALL CLOSE(file)
RETURN
_RemoveMenuHotkeys:
GETATTR KEYCOMMANDS.COUNT
clearkey = result
DO i = clearKey - 1 to 0 BY - 1
GETATTR KEYCOMMANDS.i.NAME
name1 = result
KEYBOARD NAME '"'||name1||'"' REMOVE
END
GETATTR MENUCOMMANDS.COUNT
clearMenu = result
DO i = clearMenu - 1 to 0 BY - 1
GETATTR MENUCOMMANDS.i.NAME
name1 = result
MENU NAME '"'||name1||'"' REMOVE
END
RETURN
_UpdateTMStrings:
PARSE ARG val
/* update gui for current node */
IF FIND(tm_entries,val) = 0 THEN RETURN
call topipe('id 'TM_StringNameID' dis='TMGadStatus 'gt "'TM_name.val'" ref')
call topipe('id 'TM_StringTitleID' dis='TMGadStatus 'gt "'TM_title.val'" ref')
call topipe('id 'TM_StringShortcutID' dis='TMGadStatus 'gt "'TM_shortcut.val'" ref')
call topipe('id 'TM_GetFileID' dis='TMGadStatus 'fn "'TM_command.val'" ref')
call topipe('id 'TM_StringArgsID' dis='TMGadStatus 'gt "'TM_Args.val'" ref')
RETURN
_UpdateHKStrings:
PARSE ARG val
/* update gui for current node */
IF FIND(hk_entries,val) = 0 THEN RETURN
call topipe('id 'HK_StringNameID' dis='HKGadStatus 'gt "'HK_name.val'" ref')
call topipe('id 'HK_StringHotKeyID' dis='HKGadStatus 'gt "'HK_Key.val'" ref')
call topipe('id 'HK_GetFileID' dis='HKGadStatus 'fn "'HK_command.val'" ref')
call topipe('id 'HK_StringArgsID' dis='HKGadStatus 'gt "'HK_Args.val'" ref')
RETURN
SwapTM:
TM_name.bak1 = TM_Name.prevEntry
TM_name.bak2 = TM_Name.TM_currentnode
TM_Title.bak1 = TM_Title.prevEntry
TM_Title.bak2 = TM_Title.TM_currentnode
TM_ShortCut.bak1 = TM_ShortCut.prevEntry
TM_ShortCut.bak2 = TM_ShortCut.TM_currentnode
TM_Command.bak1 = TM_Command.prevEntry
TM_Command.bak2 = TM_Command.TM_currentnode
TM_Args.bak1 = TM_Args.prevEntry
TM_Args.bak2 = TM_Args.TM_currentnode
TM_Name.prevEntry = TM_name.bak2
TM_Name.TM_currentnode = TM_name.bak1
TM_Title.prevEntry = TM_Title.bak2
TM_Title.TM_currentnode = TM_Title.bak1
TM_ShortCut.prevEntry = TM_ShortCut.bak2
TM_ShortCut.TM_currentnode = TM_ShortCut.bak1
TM_Command.prevEntry = TM_Command.bak2
TM_Command.TM_currentnode = TM_Command.bak1
TM_Args.prevEntry = TM_Args.bak2
TM_Args.TM_currentnode = TM_Args.bak1
call topipe2('id 'TM_ListViewID' list 0')
IF TM_Args.TM_currentnode ~= "" THEN commandArgs = TM_Command.TM_currentnode TM_Args.TM_currentnode
ELSE commandArgs = TM_Command.TM_currentnode||TM_Args.TM_currentnode
call topipe('id 'TM_currentnode' gt "'TM_Name.TM_currentnode'|'TM_title.TM_currentnode'|'TM_ShortCut.TM_currentnode'|'commandArgs'"')
IF TM_Args.prevEntry ~= "" THEN commandArgs = TM_Command.prevEntry TM_Args.prevEntry
ELSE commandArgs = TM_Command.prevEntry||TM_Args.prevEntry
call topipe('id 'prevEntry' gt "'TM_Name.prevEntry'|'TM_title.prevEntry'|'TM_ShortCut.prevEntry'|'commandArgs'"')
call topipe2('id 'TM_ListViewID' list 1 page' pageid)
RETURN
ShellResult:
PARSE ARG ShellCmd
cmdid='req'pragma('id')
address command 'rxset' cmdid Shellcmd
from_Shell=getclip(cmdid)
call setclip(cmdid,'')
RETURN(from_Shell)
parseTMArgs:
IF LEFT(mt_command,1) = "'" | LEFT(mt_command,1) = '"' THEN DO
TM_command.Node_ID=""
TM_Args.Node_ID = mt_command
RETURN
END
IF WORDS(mt_command) >1 THEN DO /* more than one word? */
firstchar= INDEX(mt_command,":")
IF firstchar = 0 THEN firstchar = 1
firstArg = INDEX(mt_command," ",firstchar)
IF firstArg = 0 THEN firstArg = 1
TM_command.Node_ID= SUBSTR(mt_command,1,firstArg-1)
TM_Args.Node_ID = RIGHT(mt_command,LENGTH(mt_command)-firstArg)
END
ELSE DO
TM_command.Node_ID=mt_command
TM_Args.Node_ID = ""
END
RETURN
parseHKArgs:
IF LEFT(hk_command,1) = "'" | LEFT(hk_command,1) = '"' THEN DO
HK_command.Node_ID=""
HK_Args.Node_ID = hk_command
RETURN
END
IF WORDS(hk_command) >1 THEN DO /* more than one word? */
firstchar= INDEX(hk_command,":")
IF firstchar = 0 THEN firstchar = 1
firstArg = INDEX(hk_command," ",firstchar)
IF firstArg = 0 THEN firstArg = 1
HK_command.Node_ID= SUBSTR(hk_command,1,firstArg-1)
HK_Args.Node_ID = RIGHT(hk_command,LENGTH(hk_command)-firstArg)
END
ELSE DO
HK_command.Node_ID=hk_command
HK_Args.Node_ID = ""
END
RETURN
_DisableTMGads:
PARSE ARG TMGadStatus
IF TMGadStatus.bak = TMGadStatus THEN RETURN
call topipe('id 'TM_RemoveID' dis='TMGadStatus 'ref')
call topipe('id 'TM_CloneID ' dis='TMGadStatus 'ref')
call topipe('id 'TM_UpID' dis='TMGadStatus 'ref')
call topipe('id 'TM_DownID' dis='TMGadStatus 'ref')
TMGadStatus.bak = TMGadStatus
RETURN
_DisableHKGads:
PARSE ARG HKGadStatus
IF HKGadStatus.bak = HKGadStatus THEN RETURN
call topipe('id 'HK_RemoveID 'dis='HKGadStatus 'ref')
call topipe('id 'HK_CancelBoxID' dis='HKGadStatus 'ref')
call topipe('id 'HK_ChooserID' dis='HKGadStatus 'ref')
call topipe('id 'HK_CloneID' dis='HKGadStatus 'ref')
HKGadStatus.bak = HKGadStatus
RETURN
BuildInLanguage:
/*
** $VER: THE.strings 1.0 (14.10.99) ©1999 by Nils Görs
*/
MSG_MAIN_ToolsMenu = 0
MSG_MAIN_HotkeyMenu = 1
MSG_TM_ToolsMenu = 2
MSG_HK_Hotkey = 3
MSG_TM_LV_Title = 4
MSG_HK_LV_Title = 5
MSG_Button_Add = 6
MSG_Button_Remove = 7
MSG_Button_Up = 8
MSG_Button_Down = 9
MSG_Button_Save = 10
MSG_Button_Use = 11
MSG_Button_Cancel = 12
MSG_String_Name = 13
MSG_String_Command = 14
MSG_String_Title = 15
MSG_String_ShortCut = 16
MSG_String_HotKey = 17
MSG_New_Name = 18
MSG_New_Title = 19
MSG_New_Hotkey = 20
MSG_TitleName = 21
MSG_Created = 22
MSG_MenuT_Project = 23
MSG_Menu_About = 24
MSG_Menu_Quit = 25
MSG_Request_Quit = 26
MSG_Request_YES = 27
MSG_String_Argument = 28
MSG_MenuT_Edit = 29
MSG_Menu_Remove = 30
MSG_Menu_LastSaved = 31
MSG_Button_Clone = 32
MSG_TooManyEntries = 33
strings.0 = "_Tools Menu"
strings.1 = "_Hotkey Menu"
strings.2 = "Tools Menu"
strings.3 = "Hotkeys"
strings.4 = "Name|Title|SC|Command"
strings.5 = "Name|Key|Command"
strings.6 = "_Add"
strings.7 = "_Remove"
strings.8 = "U_p"
strings.9 = "_Down"
strings.10= "_Save"
strings.11= "_Use"
strings.12= "_Cancel"
strings.13= "_Name:"
strings.14= "Co_mmand:"
strings.15= "T_itle:"
strings.16= "Sh_ortCut:"
strings.17= "_Key:"
strings.18= "Edit Name"
strings.19= "Edit Title"
strings.20= "select Hotkey"
strings.21= "Workbench Tools-Menu and Hotkey Editor"
strings.22= "Created with"
strings.23= "Project"
strings.24= "@?About"
strings.25= "@QQuit"
strings.26= "Are you sure to quit?"
strings.27= "Yes|No"
strings.28= "Ar_guments:"
strings.29= "Edit"
strings.30= "@RRemove All"
strings.31= "@LLast Saved"
strings.32= "Dup_lication"
strings.33= "Sorry, only 63 menu items will fit into the Tools menu."
RETURN